﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Runtime.CompilerServices;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using BookShop.WebUI.Infrastructure;

namespace BookShop.WebUI
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Book", action = "List", id = UrlParameter.Optional },
                namespaces: new[] { "BookShop.WebUI.Controllers" }//解决 不同位置  但是 控制器相同的情况，例如：area里面存在和 外面controller相同的
                //constraints: new { customConstraint = new UserAgentConstraint("Chrome") }
            );
        }
    }
}
